package com.kws.system.controller.contractManagement;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kws.common.core.domain.R;
import com.kws.system.domain.contractManagementDao.Rq.queryContractFilingRq;
import com.kws.system.domain.contractManagementDao.info.QueryContractFilingInfo;
import com.kws.system.service.contractTemplateService.ContractManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <b>ContractFilingController</b>
 *
 * @description: ContractFilingController <br>
 * @date: 2024/12/13 15:54 <br>
 * @author: lhm <br>
 * @version: 1.0 <br>
 */

@Api(tags = "合同存档")
@RestController
public class ContractFilingController {
    private static final Logger logger = LoggerFactory.getLogger(ContractFilingController.class);


    @Autowired
    private ContractManagementService contractManagementService;

    @ApiOperation("分页查询合同存档列表")
    @PostMapping("/query/contractFiling/page")
    public R<Page<QueryContractFilingInfo>> queryContractFilingPage(@RequestBody queryContractFilingRq rq){
        Page<QueryContractFilingInfo> pageInfo = contractManagementService.queryContractFilingPage(rq);
        return R.ok(pageInfo);
    }

    @ApiOperation("根据ID删除合同信息")
    @GetMapping("/delete/contractFiling/byId")
    public R deleteContractFilingById(@RequestParam Long id){
        boolean status = contractManagementService.deleteContractFilingById(id);
        return R.ok(status);
    }
}
